

a=[5,4,3,2,1]
print "original data: ", a
print 
for i in reversed(range(len(a))):
    print "i=", i
    print a
    for j in range(i):
	    if a[j]>a[j+1] :
		    flag = True
		    (a[j],a[j+1]) = (a[j+1], a[j])

print
print "sorted data: ", a
		
